<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>try--catch</title>
</head>
<body>
  <script>
      function test(inVal) {

          try {
              inVal = inVal.toLowerCase();
             // asd
          } catch(error) {
              alert("An error has occured. Error was :\n\n "+error.message);
          }
      }
      test(null);
  </script>

</body>
</html>
